﻿<?xml version="1.0" encoding="utf-8" ?>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly ="monitor_2_DBwork" namespace ="monitor_2_DBwork" >
  <class name="Oblast" table="Oblast">
    <id name ="Id" column ="Id" type ="int" generator="identity"/>
    <property name="Name" column="Name" type="string(30)" unique="true"/>
    <property name="IdMainRTPS" column="Idmainrtps" type="int"/>
    
    <many-to-one name="MainRTPS" cascade="all" class="RTPS" column="IdMainRTPS" lazy="false" not-null="false" unique="true"
                 insert="false" update="false"/>

    <set name="RTPSList" inverse="true" cascade="save-update" order-by="Name asc">
      <key column="Idobl" not-null="true"/>
      <one-to-many class="RTPS"/>
    </set>

    <set name="TrustedAddressList" inverse="true" cascade="save-update" order-by="Name asc">
      <key column="Idobl" not-null="true"/>
      <one-to-many class="TrustedAddress"/>
    </set>

    <set name="ServerLogList" inverse="true" cascade="save-update" order-by="Name asc">
      <key column="Idobl" not-null="true"/>
      <one-to-many class="ServerLog"/>
    </set>
    
  </class>
</hibernate-mapping>